package com.snopy.base;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.PriorityQueue;

/**
 * @author snopy
 * @version 1.0.0
 * @classname Heap
 * @description
 * @email 77912204@qq.com
 * @date 2022/05/15 22:54
 */
public class Heap {
    public static void main(String[] args) {
        //创建一个空的最小堆
        PriorityQueue<Integer> minHeap = new PriorityQueue<>();
        //创建一个空的最大堆
        PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Comparator.reverseOrder());
        //创建带初始值的堆
        PriorityQueue<Integer> heapWithValues = new PriorityQueue<>(Arrays.asList(3,1,2));

    }
}
